package com.aqie.seller.service;

import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * 签名服务
 */
@Service
public class SignService {
    static Map<String,String> PUBLIC_KEYS = new HashMap<>();
    // 随便支配authid,后面涉及如何分配
    static {
        PUBLIC_KEYS.put("1000","MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmq/XEogjMAGo4Yf4sGDU74gndkYuVSOG6SXutEvX2W+1/sCPvG8zgI4OUOs0XfwIpzTk/V9Dhpj4KqjXK91EYlMOBUQzpelf/lV+F6jez3OO22dDUG72WLg+GRk9hkBxoTZwSCvHT0MYoPsmJNka+bovJF1bu6zUle2lS6KqoEF5U12Az9ghaNihw4ohIKapXC7ZoQn2fj9/T58lPJXql3e9A7DaXtawf6S+vN6/aFq7Q19iQljSZCHuSpCT6C3mR1qFBDJ/QfJHXFzI8cn9HspLxlXWKSs9Tje+LiycL5pAYeuzbngQ7dHffJqXpd7lFVavhGLPArkB3CNSmIfKwQIDAQAB");
    }

    /**
     * 根据授权编号获取公钥
     * @param authId
     * @return
     */
    public String getPublicKey(String authId){
        return PUBLIC_KEYS.get(authId);
    }
}
